"""
根据丹仪师姐20250114给的质控excel文件，挑选出合格的wsi

"""
import os
import shutil

import pandas as pd

excel_path = '/media/hsmy/16TB/质控合格excel/中六质控合格.xlsx'
df = pd.read_excel(excel_path, header=None, usecols=[0])
column_data = df[0].str.strip().tolist()

# print(column_data)
wsi_folder = "/media/hsmy/16TB/20241110GIST_南方医_中六_核分裂/z6/wsi"
move_path = "/media/hsmy/16TB/20241110GIST_南方医_中六_核分裂/z6_不在质控合格单中"
wsi_no_check = []
wsi_all = []
for wsi in os.listdir(wsi_folder):
    wsi_all.append(wsi)
    wsi_path = os.path.join(wsi_folder, wsi)
    wsi_key = wsi.replace('.svs', '')
    if wsi_key not in column_data:
        wsi_no_check.append(wsi)
        shutil.move(wsi_path, move_path)

print(f"总数：{len(wsi_all)}")
print(f"不在质控列表：{len(wsi_no_check)}")
print(wsi_no_check)


"""
z6
总数：153
不在质控列表：21
['S1516194', 'S1603741', 's1604592', 'S1605178', 's1612513', 'S1514863', 'S1405010', 'S1405996', 's1409450', 's1410755', 'S1412093', 'S1308060', 'S1308328', 'S110399', 'S113297', 's120038', 'S120145', 's122651', 's123981', 'S125834', 'S1302764']

"""
